<?php
mmseg_load_chars('mmseg/data/chars.dic');
mmseg_load_words('mmseg/data/words-sogou.dic');
mmseg_load_words('mmseg/data/words-custom.dic');

$text = urldecode($_GET['title']);

$mmseg = mmseg_algor_create($text);

$str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$str .= "<words>";
while ($token = mmseg_next_token($mmseg)) {
		$str .= "<word>" . $token['text'] . "</word>";
}
$str .= "</words>";

echo $str;

mmseg_algor_destroy($mmseg);
?>
